import request from '@/utils/request'
const api_name = '/admin/vod/teacher'

export default {
    //讲师列表
    pageList(current, limit, searchObj) {
        return request({
            url: `${api_name}/findQueryPage/${current}/${limit}`,
            method: `post`,
            data: searchObj
        })
    },

    //删除讲师
    removeTeacherById(ID) {
        return request({
            url: `${api_name}/remove/${ID}/`,
            method: `delete`,
        })
    },

    //添加讲师
    saveTeacher(teacher) {
        return request({
            url: `${api_name}/saveTeacher/`,
            method: `post`,
            data: teacher
        })
    },
    //根据id查询
    getTeacherById(id) {
        return request({
            url: `${api_name}/getTeacher/${id}`,
            method: `get`,
        })
    },
    //更新讲师
    updateTeacher(teacher) {
        return request({
            url: `${api_name}/updateTeacher/`,
            method: `put`,
            data: teacher
        })
    },
    batchRemove(idList) {
        return request({
            url: `${api_name}/removeBatch`,
            method: `delete`,
            data: idList
        })
    },
    //所有讲师
    list() {
        return request({
            url: `${api_name}/findAll`,
            method: `get`
        })
    }

}